package com.ls.blog.vo;

import com.ls.blog.common.valid.Add;
import com.ls.blog.common.valid.Select;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserVO {

    public UserVO(String email) {
        this.email = email;
    }

    @NotNull
    Integer id;

    @NotBlank(message = "昵称不能为空",groups = {Add.class})
    String nickname;

    @NotBlank(message = "邮件不能为空",groups = {Select.class,Add.class})
    @Email(message = "必须满足邮件格式",groups = {Select.class,Add.class})
    String email;

    @NotBlank(message = "密码不能为空",groups = {Add.class})
    String password;
    /**
     * 验证码
     */
    @NotBlank(message = "验证码不能为空",groups = {Add.class})
    String checkCode;
    List<Integer> roleIds;
}
